//
//  XBWebView.h
//  TLKeepCredit
//
//  Created by mc on 2017/10/17.
//  Copyright © 2017年 mac. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>

@class XBWebView;

@protocol WBWebViewDelegate <NSObject>
@optional
- (void)wbWebView:(XBWebView *)webView didStartLoadingURL:(NSURL *)URL;
- (void)wbWebView:(XBWebView *)webView didFinishLoadingURL:(NSURL *)URL;
- (void)wbWebView:(XBWebView *)webView didFailToLoadURL:(NSURL *)URL error:(NSError *)error;
- (BOOL)wbWebView:(XBWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request;
@end

@interface XBWebView : UIView<WKNavigationDelegate, UIWebViewDelegate>

@property (nonatomic, weak) id <WBWebViewDelegate> delegate;
@property (nonatomic, strong) UIColor *progressTintColor;
@property (nonatomic, assign) BOOL hiddenProgress;

+ (XBWebView *)webView;
+ (XBWebView *)webViewWithConfiguration:(WKWebViewConfiguration *)configuration NS_AVAILABLE_IOS(8_0);

- (id)initWithConfiguration:(WKWebViewConfiguration *)configuration NS_AVAILABLE_IOS(8_0);
- (void)loadURL:(NSURL *)url withTimeoutInterval:(NSTimeInterval)timeoutInterval;
- (void)loadURLString:(NSString *)URLString withTimeoutInterval:(NSTimeInterval)timeoutInterval;
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL *)baseURL;
@end
